﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace NewerthBot
{
    public partial class Login : Form
    {
        public Login()
        {
            InitializeComponent();
        }

        private void frmLogin_Load(object sender, EventArgs e)
        {            

            if (NewerthBot.Properties.Settings.Default.RememberUser)
            {
                txtUsername.Text = NewerthBot.Properties.Settings.Default.Username;
                txtPassword.Text = NewerthBot.Properties.Settings.Default.Password;
                chkRememberUser.Checked = true;
            }
        }

        private void btnLogin_Click(object sender, EventArgs e)
        {
            NewerthBot.Properties.Settings.Default.Username = txtUsername.Text;
            NewerthBot.Properties.Settings.Default.Password = txtPassword.Text;
            NewerthBot.Properties.Settings.Default.RememberUser = chkRememberUser.Checked;

            this.DialogResult = DialogResult.OK;
        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.Cancel;
        }
    }
}
